package com.kwedding.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.kwedding.dto.app.RequestLogin;
import com.kwedding.dto.app.ResponseAccountInfo;
import com.kwedding.service.app.AccountService;
import com.kwedding.util.BackJson;
import com.kwedding.util.JsonBackBase;
import com.kwedding.util.LoggerParent;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Controller
@RequestMapping("/rest/account")
@Api(tags = "APP用户")
public class AccountController extends LoggerParent {

	@Autowired
	private AccountService accountService;

	@ApiOperation("APP用户登录")
	@ResponseBody
	@RequestMapping(value = "login", method = { RequestMethod.POST })
	private JsonBackBase<ResponseAccountInfo> login(@RequestBody RequestLogin login) {
		return BackJson.successObj(accountService.login(login));
	}
}
